﻿using System;
using System.Data;

namespace Shopping.Entities
{
    /// -----------------------------------------------------------------------------
    ///<summary>
    /// The Info class for the OrderDetailInfo
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public class OrderDetailInfo
    {
        #region Private Members
		
        private int _orderId;
        private int _productId;
        private decimal  _pride;
        private string _productName="";
        private short  _quantity;
        private decimal  _totalPrice;
        #endregion
        #region Constructors
        // initialization

        #endregion
        #region Public Properties
        /// <summary>
        /// Get and Set Property Data of File column OrderId in Table OrderDetail 
        /// </summary>
				
        public int OrderId
        {
            get{ return _orderId; }
            set{ _orderId = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column ProductId in Table OrderDetail 
        /// </summary>
				
        public int ProductId
        {
            get{ return _productId; }
            set{ _productId = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column Pride in Table OrderDetail 
        /// </summary>
				
        public decimal Pride
        {
            get{ return _pride; }
            set{ _pride = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column ProductName in Table OrderDetail 
        /// </summary>
				
        public string ProductName
        {
            get{ return _productName; }
            set{ _productName = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column Quantity in Table OrderDetail 
        /// </summary>
				
        public short Quantity
        {
            get{ return _quantity; }
            set{ _quantity = value; }
        }
				
        /// <summary>
        /// Get and Set Property Data of File column TotalPrice in Table OrderDetail 
        /// </summary>
				
        public decimal TotalPrice
        {
            get{ return _totalPrice; }
            set{ _totalPrice = value; }
        }
				
        #endregion		
		
        #region IHydratable Implementation

        /// <summary>
        /// 
        /// </summary>        
        public void Fill(IDataReader oReader)
        {
            _orderId=int.Parse(oReader["OrderId"].ToString());
            _productId=int.Parse(oReader["ProductId"].ToString());
            _pride=decimal.Parse(oReader["Pride"].ToString());
            _productName=Convert.ToString(oReader["ProductName"]);
            _quantity=short.Parse(oReader["Quantity"].ToString());
            _totalPrice=decimal.Parse(oReader["TotalPrice"].ToString());
        }
        #endregion
    }
}